package com.example.demo.service.imp;

import com.example.demo.pojo.MultiChoice;
import com.example.demo.mapper.MultiChoiceMapper;
import com.example.demo.service.MultiChoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class MultiChoiceServiceImp implements MultiChoiceService {

    @Autowired
    private MultiChoiceMapper multiChoiceMapper;

    @Override
    public List<MultiChoice> getAll() {

        return multiChoiceMapper.queryMultiChoiceList();
    }

    @Override
    public MultiChoice getById(Integer id) {
        return multiChoiceMapper.getById(id);
    }

    @Transactional
    @Override
    public void add(MultiChoice multiChoice) { multiChoiceMapper.add(multiChoice);
    }

    @Transactional
    @Override
    public void delete(Integer id) {
        multiChoiceMapper.delete(id);
    }
}
